var U83 = function () {
  function show(selector) {
     var element = document.getElementById(selector),
     display = element.style.display;
  
     if (display === "block") {
        element.style.display="none";
     } else {
        element.style.display="block";
     }
  };
  
  function addShower(id) {
   var button = document.getElementById(id);
   
   button.addEventListener('click', function () {
    show('timeTable');
   });
  };

  function addScroller() {
    var scroller = document.createElement('div'),
          tempScroll;
    
    scroller.className = 'scroller';
    scroller.innerHTML = '<span>scroll up</span>'
  
    window.onload = function () { 
      scroller.onclick = function () {
        var currentPosition = document.body.scrollTop;
  
        if (currentPosition !== 0) { 
          tempScroll = currentPosition;
          window.scrollTo(0, 0);
        } else { 
          window.scrollTo(0, tempScroll);        
        }
      }
      document.body.appendChild(scroller); 
    };
  };
  
  function removeElement(selector, position) {
    var position = position || 0,
      el;
    if (!selector || typeof selector !== 'string') {
      throw 'Please, specify proper selector';
    }
    el = document.querySelectorAll(selector)[position];
    
    el.parentNode.removeChild(el);
  };
 
  return {
    show: show,
    addScroller: addScroller,
    addShower: addShower,
    removeElement: removeElement
  };
};

function init() {
  var u83 = new U83();
  u83.addScroller();
  u83.addShower('showTimeTable');
  u83.removeElement('a[href*="[/marquee]"]');
};

(init())();